package org.icop.matcher;

import java.util.LinkedList;
import java.util.List;

import org.icop.frame.boost.Booster;
import org.icop.frame.eval.GraphEditEvaluator;
import org.icop.frame.search.Searcher;
import org.icop.frame.search.StringMetricLabelSearcher;
import org.icop.frame.select.GreedyMappingSimSelector;
import org.jbpt.graph.abs.IDirectedEdge;
import org.jbpt.graph.abs.IDirectedGraph;
import org.jbpt.hypergraph.abs.IVertex;

import uk.ac.shef.wit.simmetrics.similaritymetrics.Levenshtein;

/**
 * A simple baseline matcher that relies on the Levenshtein distance similarity to compare activity
 * labels and generate candidate correspondences. Then, selection of the mapping is done with a greedy
 * approach and guided by an evaluator that computes the score based on the graph edit distance similarity.
 * 
 * Details about this matcher can be found in:
 * 
 * Remco M. Dijkman, Marlon Dumas, Luciano García-Bañuelos, Reina Käärik: Aligning Business Process Models. EDOC 2009:45-53
 * 
 * @author mweidlich.weidlich
 *
 */
public class SimpleMatcher<G extends IDirectedGraph<E,V>, E extends IDirectedEdge<V>, V extends IVertex> extends AbstractMatcher<G, E, V> {

	public SimpleMatcher(){
		List<Searcher<G, E, V>> searchers = new LinkedList<Searcher<G, E, V>>();
		searchers.add(new StringMetricLabelSearcher<G, E, V>(0.5, false, new Levenshtein()));
		
		List<Booster<G, E, V>> boosters = new LinkedList<Booster<G, E, V>>();
		
		setSearchers(searchers);
		setBoosters(boosters);
		setEvaluator(new GraphEditEvaluator<G, E, V>(0.5,0.8,0.0,0.0));
		setSelector(new GreedyMappingSimSelector<G, E, V>());
	}
	
}
